package cn.bdqn.sys.controller;

import cn.bdqn.sys.service.ResourcesService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Awacky
 * @create 2019-07-27 16:13
 */
@RestController
//因为没有增删改查
@RequestMapping("/sys/res")
public class ResourcesController {
    //调用
    @Autowired
    private ResourcesService resourcesService;

//    @ResponseBody
//    @RequestMapping("/getmenu")
//    public Object getMenu(HttpSession session, ){
//
//    }
    @RequiresPermissions("sys:role:menuset")
    @GetMapping("/menuset")
    public Object menuset(){
        return resourcesService.getMenu().getData();
    }

    @PostMapping
    public Object getRes(Integer roleid){
        return resourcesService.getRes(roleid).getData();
    }
}
